using System;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using Framework.Interface;
using Framework.Singleton;
using Game.Model.ServerList;
using UnityEngine;

namespace Game.System
{
    public class AccountSystem: Singleton<AccountSystem>, ISystem
    {
        public List<ServerInfoDto> serverList;

        public ServerInfoDto current;

        public long connectionId;

        public async UniTask Initialize()
        {
            await UniTask.CompletedTask;
        }

        public void Shutdown()
        {
            
        }

        public void SetSelect(int index = 0)
        {
            Debug.Log($"server list count: {serverList.Count}");
            current = serverList[index];
        }

        public ServerInfoDto GetCurrentServer()
        {
            return current;
        }

        public void SetConnection(long connId)
        {
            connectionId = connId;
            // Debug.Log("connection id: " + connectionId);
        }
    }
}